﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Xajhzwb.Components.Util
{
    public class Const
    {
        /// <summary>
        /// class type
        /// </summary>
        public enum ClassType
        {
            Gather, // 采集
            Global, // 过滤
            Publish, // 发布
            Plan, // 计划
            Task, // 任务
        }

        public enum DataType
        {
            Access = 1,
            SqlServer = 2,
            Oracle = 3,
            Mysql = 4,
            SqlLite = 5,
        }

        public enum MessageType
        {
            RunSpiderTask = 3010,
            RunFileTask = 3011,
            RunData = 3013,
            ReloadPlan = 3013,
            MonitorFileFaild = 3014,
        }

        public enum LimitSign
        {
            NoLimit = 2001,          //不做任意格式的限制
            NoWebSign = 2002,        //匹配时去掉网页符号
            OnlyCN = 2003,           //只匹配中文
            OnlyDoubleByte = 2004,     //只匹配双字节字符
            OnlyNumber = 2005,         //只匹配数字
            OnlyChar = 2006,           //只匹配字母数字及常用字符
            Custom = 2007,           //自定义正则匹配表达式 
        }
        
        /// <summary>
        /// log type
        /// </summary>
        public enum LogType
        {
            Info = 2061,
            Error = 2062,
            Warning = 2063,
            RunPlanTask = 2064,
            GatherError = 2065,
            PublishError = 2066,
        }

        /// <summary>
        /// publish type
        /// </summary>
        public enum PublishType
        {
            NoPublish = 0,
            PublishWeb = 1,
            PublishTxt = 2,
            PublishExcel = 3,
            PublishAccess = 4,
            PublishMsSql = 5,
            PublishMySql = 6,
        }

        public enum GatherThreadState
        {
            UnStart = 1030,
            Started = 1031,
            Running = 1032,
            Stopped = 1033,
            Completed = 1034,
            Failed = 1035,
            Aborted = 1036,
            Waiting = 1037,
        }

        public enum RunTaskType
        {
            QidorTask = 2071,           //Qidor采摘任务
            DataTask = 2072,               //数据库存储过程
            OtherTask = 2073,            //外接可执行命令
        }

        public enum RunTaskPlanType
        {
            Ones = 2081,                //仅运行一次
            DayOnes = 2082,             //每天运行一次
            DayTwice = 2083,            //每天上午下午各运行一次
            Weekly = 2084,              //每周运行
            Custom = 2085,              //自定义运行间隔
        }

        public enum PlanDisabledType
        {
            RunTime = 2091,            //按照运行次数失效
            RunDateTime = 2092,        //按照时间失效 
        }

        public enum PlanState
        {
            Enabled = 3001,           //有效
            Disabled = 3002,          //无效
            Expired = 3003,          //过期
        }

    }
}
